//
//  ViewController.m
//  WMUpdateView
//
//  Created by mac on 16/2/21.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ViewController.h"
#import "WMUpdateView.h"


@interface ViewController ()
@property(nonatomic,strong) UIWindow *window;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 0, 200,300)];
    [self.view addSubview:imageView];
    imageView.image = [UIImage imageNamed:@"j0178537"];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(100, 100, 60, 30);
    [button setTitle:@"点我" forState:UIControlStateNormal];
    [button setBackgroundColor:[UIColor blackColor]];
    [button addTarget:self action:@selector(buttonDidClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    
}

- (void)buttonDidClick:(UIButton *)btn{
    
    WMUpdateView *updateView = [[WMUpdateView alloc] initWithTitle:nil
                                                          imageUrl:nil
                                                       contentText:@"sdfaskdfl;ak;sdfl;a;dlf\nkasjdfkajsdkfsdfjkj\n"
                                                      confirmTitel:@"立即升级"
                                                              type:WMUpdateViewTypeNormal
                                                      confirmBlock:^{
                                                          NSLog(@"confirmBlock");
                                                      }
                                                       cancleBlock:^{
                                                           NSLog(@"cancleBlock");
                                                           
                                                       }];
    
    [updateView show];
}


@end
